<template>
    <div>
        <div class="container-index-header bg" :style="{backgroundImage:'url('+adImage.url+')'}">
            <div style="background-color:#143f87">
                 <MainNav :logo="tree.index_logo.children"></MainNav>
            </div>
        </div>
        <div class="container">
            <!--注释行为在背景图片上显示一个绝对定位的该模块的标题-->
            <!-- <div style="position:absolute;top:-150px;font-size:50px;color:#fff;background:rgb(20, 63, 135);padding-left:10px;padding-right:50px">{{ module_name }}平台</div> -->
            <router-view></router-view>
        </div>   
        <BackTop></BackTop>
        <MainFooter></MainFooter>
    </div>
</template>

<script>
import MainNav from '../main-components/nav'
import MainFooter from '../main-components/footer'
    export default {
        components:{MainNav,MainFooter },
        data(){
            return{
                login:true,
                register:true,
                message:0,
                theme1:'light',
                adImg:{path:'',url:''}
            }
            
        },
        methods:{

        },
        computed: {
            module_name() {
                return this.$route.params.name;
            },
            tree(){
                return this.$store.state.app.dicTree;
            },
            adImage(){
                var temp = this.tree.usual_service.children.filter( elem => elem.name == this.module_name ).map( elem => {
                    return { url: elem.logo.length ? elem.logo[0].url : "", path: elem.path }
                });
                if(temp.length > 0) this.adImg = temp[0];
                return this.adImg;
            }
        }
    }
</script>

<style scoped>
/* 
    2018/01/08
    author:liumingyuan
*/
/* 版心样式 */
.container{
    position: relative;
    width: 58%;
    margin: 0 auto;
    padding-bottom: 10px;
    min-width: 960px;
    padding-top: 10px;
}
.container-index-header{
    height:350px;
    position: relative;
}
.bg{
    background-repeat: no-repeat;
    background-size: 100% 100%;
    background-position: center center;
}

</style>
